package com.zmn.oms.services.impl.conf.distribute;

import com.zmn.oms.model.entity.conf.distribute.*;
import com.zmn.oms.persistence.interfaces.conf.distribute.RobOrderConfigDao;
import com.zmn.oms.persistence.interfaces.conf.distribute.RobOrderRelationDao;
import com.zmn.oms.persistence.interfaces.conf.distribute.RobOrderRelationProductDao;
import com.zmn.oms.services.interfaces.conf.distribute.RobOrderConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 描述:抢单配置接口实现类
 *
 * @param
 * @author tanlei
 * @return
 * @since 2021/7/12 13:32
 */
@Slf4j
@Service
public class RobOrderConfigServiceImpl implements RobOrderConfigService {

    @Resource
    private RobOrderConfigDao robOrderConfigDao;

    @Resource
    private RobOrderRelationDao robOrderRelationDao;

    @Resource
    private RobOrderRelationProductDao robOrderRelationProductDao;

    @Override
    public Integer insert(RobOrderConfigInfo robOrderConfigInfo) {

        return robOrderConfigDao.insert(robOrderConfigInfo);
    }

    @Override
    public Integer insertBatch(List<RobOrderRelation> robOrderRelationList) {
        return robOrderRelationDao.insertBatch(robOrderRelationList);
    }

    @Override
    public Integer insertBatchProduct(List<RobOrderRelationProduct> robOrderRelationProductList) {
        return robOrderRelationProductDao.insertBatch(robOrderRelationProductList);
    }

    @Override
    public Integer insertRelationProductData(RobOrderRelationProduct robOrderRelationProduct) {
        return robOrderRelationProductDao.insert(robOrderRelationProduct);
    }

    @Override
    public Integer insertRelationData(RobOrderRelation robOrderRelation) {
        return robOrderRelationDao.insertRelationData(robOrderRelation);
    }

    @Override
    public Integer updateByKey(RobOrderConfigInfo robOrderConfigInfo) {
        return robOrderConfigDao.updateByKey(robOrderConfigInfo);
    }

    @Override
    public Integer updateStatus(UpdateStatusQuery updateStatusQuery) {
        return robOrderConfigDao.updateStatus(updateStatusQuery);
    }

    @Override
    public Integer updateRelationDataByKey(RobOrderRelation robOrderRelation) {
        return robOrderRelationDao.updateByKey(robOrderRelation);
    }

    @Override
    public Integer updateBatchProductByKey(List<RobOrderRelationProduct> robOrderRelationProductList) {
        return robOrderRelationProductDao.updateBatchByKey(robOrderRelationProductList);
    }

    @Override
    public Integer updateBatchByKey(List<RobOrderRelation> robOrderRelationList) {
        return robOrderRelationDao.updateBatchByKey(robOrderRelationList);
    }

    @Override
    public Integer countByQuery(RobOrderConfigInfoQuery query) {
        return robOrderConfigDao.countByQuery(query);
    }

    @Override
    public List<RobOrderRelation> listByQuery(RobOrderRelationQuery query) {
        return robOrderRelationDao.listByQuery(query);
    }

    @Override
    public List<RobOrderRelationProduct> listProductByQuery(RobOrderRelationProductQuery query) {
        return robOrderRelationProductDao.listProductByQuery(query);
    }

    @Override
    public RobOrderConfigInfo findByKey(Integer configId) {
        return robOrderConfigDao.findByKey(configId);
    }

    @Override
    public void deleteByConfigId(Integer configId) {
        robOrderRelationDao.deleteByConfigId(configId);
    }

    @Override
    public void deleteByRelationId(Integer relationId) {
        robOrderRelationProductDao.deleteByRelationId(relationId);
    }

    @Override
    public RobOrderConfigInfo findRobOrderConfigByQuery(RobOrderQuery query) {
        return robOrderConfigDao.findRobOrderConfigByQuery(query);
    }

    @Override
    public RobOrderConfigInfo findCompanyRobOrderConfigByQuery(RobOrderQuery query) {
        return robOrderConfigDao.findCompanyRobOrderConfigByQuery(query);
    }

    @Override
    public List<RobOrderConfigInfo> listConfigInfoByConfigIds(List<Integer> configIds) {
        return robOrderConfigDao.listConfigInfoByConfigIds(configIds);
    }
}
